package com.ui.BRVAH;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.SectionEntity;
import com.orangelife.R;

import java.util.List;

/**
 * 设置分组布局
 * Created by ZeroVoid on 2018-9-7.
 */

public class MySectionAdapter extends BaseSectionQuickAdapter<MySectionEntity, BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param layoutResId      The layout resource id of each item.
     * @param sectionHeadResId The section head layout id for each item
     * @param data             A new list is created out of this one to avoid mutable list
     */
    public MySectionAdapter(int layoutResId, int sectionHeadResId, List data) {
        super(layoutResId, sectionHeadResId, data);
    }


    @Override
    protected void convertHead(BaseViewHolder helper, final MySectionEntity item) {
        helper.setText(R.id.head, item.header);
    }


    @Override
    protected void convert(BaseViewHolder helper, MySectionEntity item) {
        helper.setText(R.id.content, item.t.getMyText());
    }
}
